/*Name:		Rio Atmadja
  Program:	client.cpp
*/

#include "stack_array.h"
#include <iostream>
#include <string>
using namespace std;

int main() {
	
	stack_array<int> stack; //create a stack object

	//fill the stack with integers
	for(int i=1; i<=10; i++ ) {
		stack.push(i);
	}

	stack.print_to_file(); //print to a file

	cout << "insert integers into the stack --> [ ";	
	while( !stack.isEmpty() ) {
		cout << stack.top() <<  " ";
		stack.pop();
	}	
	cout << "] " << endl;
	
	cout << "is this stack empty --> " <<  ( stack.isEmpty() ? "true" : "false" ) << endl;
	cout << "Testing the read file function --> " << ( stack.read_file() ? " true ":" false " ) << endl;
	cout << "is this stack empty --> " <<  ( stack.isEmpty() ? "true" : "false" )  << endl;
	while( !stack.isEmpty() ) {
		cout << stack.top() << " ";
		stack.pop();
	}

	stack_array<char> list;	
	string word = "Iamastudent";
	cout << "I'm goint to put this string into the list --> " << word << endl;	
	for(int i=0; i<word.length(); i++) {
		list.push(word[i]);
	}
	
	cout << "I'm going to shuffle the stack " << endl;
	list.shuffle();
	//cout << "Here is the output --> "; list.print();
	cout << "The size of the list is --> " << list.length() << endl;

	while( !list.isEmpty() ) {
		cout << list.top() << endl;
		list.pop();
	}

	
}
